home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / E-Z Progress Bar 1.0a / ChiselClass.h < prev    next >
C/C++ Source or Header  |  1995-03-14  |  3KB  |  81 lines

  1. #pragma once
  2. #include "Environ.h"
  3.  
  4. //        Chisel Class defaults : use "dirty white", no black border, chisel "in" when Chisel called
  5. enum    chiselFlags { chiselDefaults=-1, dirtyWhite=2, noBlackBorder=4, chiselIn=8 };
  6.  
  7. class    ChiselClass {
  8.  
  9.     RGBColor    liteChisel, darkChisel, darkGrey, myWhite, myBlack, myDirtyWhite;
  10.     Boolean        useRGB, addBlackBorder, chiselWay, useDefaultRect;
  11.     short        borderWidth, blackWidth;
  12.     Rect        dRect;
  13.     void        Chisel(Rect theRect, Boolean out);
  14.     void        HairChisel(Rect &theRect, Boolean out);
  15.     void        InitializeVars(short options);
  16.     
  17.     int        GetHi(RGBColor &color);
  18.     int        GetLo(RGBColor &color);
  19.     
  20.     int        kColorPress, kMinColor, kMaxColor;
  21.     
  22. public:
  23.  
  24.     ChiselClass(short options=chiselDefaults);
  25.     ChiselClass(Rect defaultRect, short options=chiselDefaults);
  26.     
  27.     void    Chisel();                        //    Chisel the default rect in default ways
  28.     
  29.     void    Chisel(Rect theRect);            //    Chisel theRect in default ways
  30.     void    ChiselOut(Rect theRect);        //    Chisel (out) theRect
  31.     void    ChiselIn(Rect theRect);            //    Chisel (in) theRect
  32.     
  33.     void    HairChisel();                    //    Produces a hairline chisel effect with default rect
  34.     
  35.     void    HairChisel(Rect theRect);        //    Hairline chisel theRect in default ways
  36.     void    HairChiselOut(Rect theRect);    //    Hairline chisel out (black on left and top)
  37.     void    HairChiselIn(Rect theRect);        //    Hairline chisel in    (black on right and bottom)
  38.     
  39.     Rect    ChiselRect(Rect theRect);        //    Passed a Rect, returns chisel rect of that Rect
  40.     Rect    ChiselRect();                    //    Returns default chisel Rect
  41.     Rect    PreChisel(Rect theRect);        //    Returns the original rect needed to obtain a chisel
  42.                                             //    rect the size of theRect passed
  43.     Rect    PreChisel();
  44.  
  45.     void    CleanRect();                    //    Erases the default rect ChiselIn/Out would create
  46.     void    CleanRect(Rect theRect);        //    Erases the rectangle ChiselIn/Out would create
  47.  
  48.     void    InvalChisel();                    //    Invalidates default rect ChiselIn/Out would create
  49.     void    InvalChisel(Rect theRect);        //    Invalidates rect ChiselIn/Out would create
  50.     
  51.     void    SetDefaultRect(Rect &theRect);                    //    Set default rect
  52.     void    SetOptions(short options=chiselDefaults);        //    Set options (if you can't when declaring the var)
  53.     void    SetChiselWay(short chiselDir);                    //    Set default chisel direction (use
  54.                                                             //    chiselIn or !chiselIn)
  55.  
  56.     void    SetChiselWidth(short width);        //    Set width of chisel, in pixels, default is 3
  57.                                                 //    Note: This automatically sets black border
  58.                                                 //    width to half this value
  59.                                                 
  60.     void    SetBlackBorderWidth(short width);    //    Set width of black border inside chisel,
  61.                                                 //    automatically half of chisel width, unless
  62.                                                 //    overridden here
  63.  
  64.     void    SetDarkChiselColor(RGBColor darkColor);    //    dark chisel color
  65.     void    SetLiteChiselColor(RGBColor    liteColor);    //    lite chisel color
  66.     void    SetFrameColor(RGBColor frameColor);        //    black border color
  67.     void    LiteDarkFrom(RGBColor baseColor);        //    gets the light and dark shades from the
  68.                                                     //    base color and sets them to the light and
  69.                                                     //    dark components of the chisel class
  70.  
  71.     void    LiteFrom(RGBColor baseColor);            //    sets the light component from baseColor
  72.     void    DarkFrom(RGBColor baseColor);            //    sets the dark component from baseColor
  73.     
  74.     void    UseDirtyWhite(Boolean dirty);            //    Toggle the use of a dirty over a pure white
  75.                                                     //    in the edging
  76.                                                     
  77.     void    UseBlackFrame(Boolean useBlackBorder);
  78. };
  79.  
  80.  
  81.